package com.ant.storage.controller;


import com.ant.storage.common.ResultPage;
import com.ant.storage.common.ResultVo;
import com.ant.storage.dto.ReimburseInfoDto;
import com.ant.storage.dto.ReimburseInfosDto;
import com.ant.storage.dto.ReimbursementDto;
import com.ant.storage.pojo.ReimburseInfo;
import com.ant.storage.pojo.ReimburseInfoLog;
import com.ant.storage.pojo.Reimbursement;
import com.ant.storage.service.IReimburseInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hzd
 * @since 2023-09-22
 */
@RestController
@RequestMapping("/reimburseInfo")
public class ReimburseInfoController {

    @Autowired
    private IReimburseInfoService reimburseInfoService;

    @ApiOperation(value = "获取报销信息列表接口")
    @GetMapping("/getReimburseInfoPage")
    public ResultPage getReimburseInfoPage(ReimburseInfoDto dto)
    {
        return ResultPage.success("获取成功",reimburseInfoService.getReimburseInfoPageList(dto));
    }

    @ApiOperation(value = "报销申请填写")
    @PostMapping("/ReimburseInfoSave")
    private ResultVo ReimburseInfoSave(@RequestBody ReimburseInfosDto dto) {
        return  reimburseInfoService.reimburseInfoSave(dto);
    }

    @ApiOperation(value = "报销申请填写")
    @PostMapping("/applyAdopt")
    private ResultVo applyAdopt(@RequestBody ReimburseInfoLog log) {
        return  reimburseInfoService.applyAdopt(log);
    }


    @ApiOperation(value = "报销申请填写")
    @GetMapping("/ReimburseInfoById/{id}")
    private ResultVo ReimburseInfoById(@PathVariable("id") Integer id) {
        return  ResultVo.success("获取成功",reimburseInfoService.ReimburseInfoById(id));
    }

}
